package com.linkage.jz.bankruptcy.bean;

import android.text.TextUtils;

import com.google.gson.Gson;
import com.google.gson.JsonObject;

import java.io.Serializable;
import java.util.List;

/**
 * @author AFAP
 * 任务详情
 */
public class ProTaskDetail implements Serializable {
    private String id; // 任务id
    private String bankruptcyProjectId; // 项目id
    private String taskName; // 任务名称
    private String taskContent; // 任务内容
    private String memberId; // 任务执行人id

    public String getSysUserId() {
        return sysUserId;
    }

    public void setSysUserId(String sysUserId) {
        this.sysUserId = sysUserId;
    }

    private String sysUserId;
    private long deadlineTime; // 任务截止时间
    private CommonStatusInfo status; // 任务状态 0-未处理 1-超市未处理 2-已完成
    private long finishTime; // 任务完成时间
    private String feedbackMessage; // 回馈信息
    private UserInfo executor; // 执行人
    private UserInfo creator; // 创建人
    private List<TaskAtta> taskAtta; // 任务附件
    private long opAt;
    private boolean isCreator;
    private boolean isExecutor;


    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getBankruptcyProjectId() {
        return bankruptcyProjectId;
    }

    public void setBankruptcyProjectId(String bankruptcyProjectId) {
        this.bankruptcyProjectId = bankruptcyProjectId;
    }

    public String getTaskName() {
        return taskName;
    }

    public void setTaskName(String taskName) {
        this.taskName = taskName;
    }

    public String getTaskContent() {
        return taskContent;
    }

    public void setTaskContent(String taskContent) {
        this.taskContent = taskContent;
    }

    public String getMemberId() {
        return memberId;
    }

    public void setMemberId(String memberId) {
        this.memberId = memberId;
    }

    public long getDeadlineTime() {
        return deadlineTime;
    }

    public void setDeadlineTime(long deadlineTime) {
        this.deadlineTime = deadlineTime;
    }

    public CommonStatusInfo getStatus() {
        return status;
    }

    public void setStatus(CommonStatusInfo status) {
        this.status = status;
    }

    public long getFinishTime() {
        return finishTime;
    }

    public void setFinishTime(long finishTime) {
        this.finishTime = finishTime;
    }

    public String getFeedbackMessage() {
        return feedbackMessage;
    }

    public void setFeedbackMessage(String feedbackMessage) {
        this.feedbackMessage = feedbackMessage;
    }

    public UserInfo getExecutor() {
        return executor;
    }

    public void setExecutor(UserInfo executor) {
        this.executor = executor;
    }

    public UserInfo getCreator() {
        return creator;
    }

    public void setCreator(UserInfo creator) {
        this.creator = creator;
    }

    public List<TaskAtta> getTaskAtta() {
        return taskAtta;
    }

    public void setTaskAtta(List<TaskAtta> taskAtta) {
        this.taskAtta = taskAtta;
    }

    public long getOpAt() {
        return opAt;
    }

    public void setOpAt(long opAt) {
        this.opAt = opAt;
    }

    public boolean isCreator() {
        return isCreator;
    }

    public void setCreator(boolean creator) {
        isCreator = creator;
    }

    public boolean isExecutor() {
        return isExecutor;
    }

    public void setExecutor(boolean executor) {
        isExecutor = executor;
    }

    public static ProTaskDetail parse(JsonObject obj) {
        ProTaskDetail bean = new Gson().fromJson(obj, ProTaskDetail.class);
        if (TextUtils.isEmpty(bean.getCreator().getAvatar())) {
            bean.getCreator().setAvatar("NA");
        }
        if (TextUtils.isEmpty(bean.getExecutor().getAvatar())) {
            bean.getExecutor().setAvatar("NA");
        }
        return bean;
    }

}
